<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	  xmlns:c="http://java.sun.com/jsp/jstl/core">

<ui:composition template="../Templates/Template.xhtml">
	<ui:define name="title">Rendez Vous</ui:define>
		
	<ui:define name="contenu">
	<c:choose>
			<c:when test="#{loginBean.exist()}">
		<h:form id="form">

			<p:growl id="messages" showDetail="true" />
			<div align="center">
				<p:schedule id="schedule" value="#{rendezVousSchedule.eventModel}"
					style="height:400px;width:600px;" widgetVar="myschedule"
					resizable="false" firstHour="8" minTime="8" maxTime="19"
					styleClass="color:red;" rendered="true">
					<p:ajax event="eventSelect" oncomplete="consultp.show();"
						listener="#{scheduleController.onEventSelect }"  />
						

				</p:schedule>
			</div>

		</h:form>

		<h:form id="conspatient">
			<p:dialog widgetVar="consultp" header="Patient Details"
				showEffect="clip" hideEffect="clip" id="patiens" resizable="false"
				closable="true" closeOnEscape="true" rendered="true" >
				<h:panelGrid id="DetailPatient" columns="3" rendered="true">
	
					
					<h:outputLabel for="Nom" value="Nom :" />
					<p:inputText id="Nom" value="#{scheduleController.patient.nom}"
						rendered="true" disabled="true" />
					<h:outputLabel value="" />

					<h:outputLabel value="Prenom :" />
					<p:inputText value="#{scheduleController.patient.prenom}"
						id="Prenom" disabled="true" rendered="true" />
					<h:outputLabel value="" />

					<h:outputLabel value="Etat Civil :" />
					<p:inputText value="#{scheduleController.patient.etatcivil}"
						id="etatc" disabled="true" rendered="true" />
					<h:outputLabel value="" />

					<h:outputLabel value="Date de naissance :" />
					<p:inputText value="#{scheduleController.patient.datenaissance}"
						id="daten" disabled="true" rendered="true" />
					<h:outputLabel value="" />

					<h:outputLabel value="Profession :" />
					<p:inputText value="#{scheduleController.patient.profession}"
						id="Profession" disabled="true" rendered="true" />
					<h:outputLabel value="" />
					<h:outputLabel value="Telephone :" />
					<p:inputText value="#{scheduleController.patient.tel}"
						id="Telephone" disabled="true" rendered="true" />
					<h:outputLabel value="" />
				</h:panelGrid>

			</p:dialog>
		</h:form>
							</c:when>

			<c:otherwise>
				<h:form>
<!-- 					<p:commandButton value="Se Connecter" -->
<!-- 						action="Login?faces-redirect=true" /> -->
<script language="javascript"><!--
location.replace("Login.jsf")
//-->
</script>
						
				</h:form>
				
			</c:otherwise>
		</c:choose>
	</ui:define>

</ui:composition>
</html>